﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Rison.BusinessFacade.Helper;

namespace Rison.Web.Common
{
    public class PageBase : Page
    {
        protected string UrlBase
        {
            get { return PageGlobalParams.PageUrlBase; }
        }

        protected string UrlBase2
        {
            get { return PageGlobalParams.PageUrlBase2; }
        }

        /// <summary>
        /// View页面选择列跳转到Edit页面时，传递的对象的主键值。
        /// </summary>
        protected virtual string key
        {
            get
            {
                if (!StringHelper.IsNullOrEmpty(Request.QueryString["key"]))
                {
                    return Request.QueryString["key"];
                }
                return string.Empty;
            }
        }

        /// <summary>
        /// View页面链接到Edit页面时，是点添加新增数据或点选择列编辑数据。
        /// 返回true，表示是进行编辑已有数据。
        /// </summary>
        protected bool IsEdit
        {
            get { return !StringHelper.IsNullOrEmpty(Request.QueryString["key"]); }
        }
    }
}
